package io.tim.mvc_f2.proxy.test;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class test05 {

	public static void main(String[] args) {
		ApplicationContext context = new ClassPathXmlApplicationContext("io/tim/mvc_f2/proxy/test/Spring.xml");
		HelloImpl helloImpl = (HelloImpl) context.getBean("greetingProxy2");
		helloImpl.say("greetingProxy2");
		
		// 将目标类强制向上转型为 Apology 接口（这是引入增强给我们带来的特性，也就是“接口动态实现”功能）
		Apology apology = (Apology) helloImpl;
		apology.saySorry("greetingProxy2");
	}
}
